#include <iostream>
using namespace std;
int main()
{
	char src[101];
	int n;
	cin>>n;
	for(int i=0;i<n;i++) cin>>src[i];
	int k;
	cin>>k;
	for(int i=0;i<n;i++){
		if(src[i]>='A'&&src[i]<='Z'){
			k=k%26;
			if(src[i]+k>'Z'){
				src[i]='A'+(src[i]+k-'Z'-1);
			}
			else{
				src[i]+=k;
			}
		}
		else if(src[i]>='a'&&src[i]<='z'){
			k=k%26;
			if(src[i]+k>'z'){
				src[i]='a'+(src[i]+k-'z'-1);
			}
			else{
				src[i]+=k;
			}
		}
		else{
			
		}
		cout<<src[i];
	}
	cout<<endl;
	return 0;
} 
